<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			
			let arr = [10,30,5,8,20,9,38];
			// for(let i = 0; i<arr.length ;i++){
			// 	 console.log("arr[%d] : %d",i,arr[i]);  
			// }
			
			//循环数组的变体
			// for(let index in arr){
			// 	console.log("In   index: %d\titem:%d",index,arr[index])
			// }
			
			//使用forEach
			// arr.forEach(function(item,index){
			// 	console.log("ForEach index: %d\titem:%d",index,item ,this)				
			// })
			
			
			//forEach使用箭头函数
			arr.forEach((item,index)=>{
				console.log("ForEach index: %d\titem:%d",index,item )				
			})
			console.log("====================")
			
			//JSON对象
			let person = {
				name:'张飞',
				age: 19,
				address: '当阳桥'
			}
			person["name"]
			person.age
			
			
			for(let key in person){
				console.log("key:%s \t value:%s ", key  , person[key] )	
			}
			
			
			
			
		</script>
	</head>
	<body>
	</body>
</html>
